package fr.neyb.bernouilli.problem004;

import fr.neyb.bernouilli.common.math.MyMath;

public class Entry {

	public static void main(String... args) {
		int result = 999999;

		for (boolean found = false; !found; result--)
			if (MyMath.isPalindromic(result))
				for (int i = 999; i >= 100; i--) {
					found = (result % i == 0 && Math.log10(result / i) <= 2);
					if (found)
						break;
				}

		System.out.println(result + 1);
	}
}
